import functools
import math
class Solution(object):
    def minSkips(self, dist, speed, hoursBefore):
        n = len(dist)
        e = 10 ** (-8)
        @functools.cache
        def dfs(i, j):
            if j == 0:
                if i == 0:
                    return dist[i] / speed
                else:
                    return dfs(i - 1, j) + dist[i] / speed
            else:
                if j > i:
                    return float('inf')
                else:
                    return min(math.ceil(dfs(i - 1, j - 1) - e) + dist[i] / speed, dfs(i - 1, j) + dist[i] / speed)    
        for j in range(n - 1, -1, -1):
            if math.ceil(dfs(n - 1, j) - e) <= hoursBefore:
                return n - 1 - j
        return -1



data = Solution()
dist = [7,3,5,5]
speed = 2
hoursBefore = 10
print(data.minSkips(dist, speed, hoursBefore))